﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Matrix
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = 5;
            double[,] elems = new double[n, n];
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    elems[i, j] = i + j;
                }
            }
            GeneralMatrix m = new GeneralMatrix(n, elems);
            double[][] elemsUpper = new double[n][];
            for (int i = 0; i < n; i++)
            {
                elemsUpper[i] = new double[n - i];
                for (int j = 0; j < n - i; j++)
                {
                     elemsUpper[i][j] = i * j + Math.Max(i,j) + 1;
                }
            }
            
            UpperTriangleMatrix m1 = new UpperTriangleMatrix(n, elemsUpper);
            UpperTriangleMatrix m5 = new UpperTriangleMatrix(n, elemsUpper);
            ScalarMatrix sm = new ScalarMatrix(n, 13);
            GeneralMatrix gm = m.Mul(sm);
            gm = m.Add(sm);
            gm = m.Subtract(sm);
            GeneralMatrix m2 = (GeneralMatrix)m.Add(m1);
            //UpperTriangleMatrix m3 = (UpperTriangleMatrix)m.Add(m1);
            UpperTriangleMatrix m4 = (UpperTriangleMatrix)m1.Add(m5);

        }
    }
}
